package com.example.designPattern.absfactory.factory;

import com.example.designPattern.absfactory.abspizza.BjChinesePizza;
import com.example.designPattern.absfactory.abspizza.BjGreePizza;
import com.example.designPattern.absfactory.abspizza.LdChinesePizza;
import com.example.designPattern.factory.pizza.Pizza;

/**
 * 伦敦工厂实现工厂抽象类
 */
public class LdFactory implements AbsFactory{

    private Pizza pizza;

    @Override
    public Pizza createPizza(String pizzaType) {
        System.out.println("--- 伦敦工厂类进行生产---");
        if(pizzaType.equals("gree")){
            pizza = new LdChinesePizza();
        }else if(pizzaType.equals("chinese")){
            pizza = new LdChinesePizza();
        }else {
            return null;
        }
        return pizza;
    }
}
